package com.xsmart.order.api.wx;

import com.xsmart.common.entity.RequestBean;
import com.xsmart.common.entity.ResponseBean;
import com.xsmart.order.services.wx.WxOrderListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @author xuqinyuan
 */
@RestController
@RequestMapping("/api")
public class WxOrderListController {
    /**
     * 我的订单
     */
    @Autowired
    WxOrderListService wxOrderListService;


    /**
     * 查询订单详情
     * @param requestBean
     * @param request
     * @return
     */
    @PostMapping(value = "/v1/WxOrderListService/queryOrderDetail")
    public ResponseBean queryOrderDetail(@ModelAttribute RequestBean requestBean, HttpServletRequest request){
        return wxOrderListService.queryOrderDetail(requestBean);
    }

    /**
     * 查询订单
     * @param requestBean
     * @param request
     * @return
     */
    @PostMapping(value = "/v1/WxOrderListService/queryOrderList")
    public ResponseBean queryOrderList(@ModelAttribute RequestBean requestBean, HttpServletRequest request) {
        return wxOrderListService.queryOrderList(requestBean);
    }

    /**
     * 查询订单数量
     * @param requestBean
     * @param request
     * @return
     */
    @PostMapping(value = "/v1/WxOrderListService/queryOrderCount")
    public ResponseBean queryOrderCount(@ModelAttribute RequestBean requestBean, HttpServletRequest request) {
        return wxOrderListService.queryOrderCount(requestBean);
    }

    /**
     * 修改订单状态
     * @param requestBean
     * @param request
     * @return
     */
    @PostMapping(value = "/v1/WxOrderListService/modOrderStatus")
    public ResponseBean  modOrderStatus(@ModelAttribute RequestBean requestBean, HttpServletRequest request){
        return wxOrderListService.modOrderStatus(requestBean);
    }

    /**
     * 查询分销商的订单
     * @param requestBean
     * @param request
     * @return
     */
    @PostMapping(value = "/v1/WxOrderListService/queryDistributerOrder")
    public ResponseBean  queryDistributerOrder(@ModelAttribute RequestBean requestBean, HttpServletRequest request){
        return wxOrderListService.queryDistributerOrder(requestBean);
    }

    /**
     * 查询分销商的订单数量
     * @param requestBean
     * @param request
     * @return
     */
    @PostMapping(value = "/v1/WxOrderListService/queryDistributerOrderCount")
    public ResponseBean  queryDistributerOrderCount(@ModelAttribute RequestBean requestBean, HttpServletRequest request){
        return wxOrderListService.queryDistributerOrderCount(requestBean);
    }

    /**
     * 查询分销商的下线会员信息
     * @param requestBean
     * @param request
     * @return
     */
    @PostMapping(value="/v1/WxOrderListService/queryDistributorMember")
    public ResponseBean queryDistributorMember(@ModelAttribute RequestBean requestBean,HttpServletRequest request){
        return wxOrderListService.queryDistributorMember(requestBean);
    }

    @PostMapping(value = "/v1/WxOrderListService/addOrderSettle")
    public ResponseBean addOrderSettle(@ModelAttribute RequestBean requestBean, HttpServletRequest request){
        return wxOrderListService.addOrderSettle(requestBean);
    }

}
